# 开发时间: 2024/1/14 20:27


class Person(object):
    def __init__(self, name, age):
        self.name=name
        self.age=age

    def info(self):
        print(self.name, self.age)


class Student(Person):
    def __init__(self, name, age, stu_id):
        super().__init__(name, age)     # 使用super函数继承父类
        self.stu_id=stu_id


class Teacher(Person):
    def __init__(self, name, age, teach_year):
        super().__init__(name, age)
        self.teach_year=teach_year

"""
stu=Student('张三', 17, 2022189)
th=Teacher('李四', 22, 3)
stu.info()      # 继承父类的方法
th.info()       # 继承父类的方法
"""

class A(object):
    pass

class B(object):
    pass

class C(A, B):
    pass


